package com.algo.tests;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;

import com.algo.tools.dataset_converter.Formats;
import com.algo.tools.dataset_converter.SequenceDatabaseConverter;

public class MainTestConvertSequenceDatabase {
	
	public static void main(String [] arg) throws IOException{
		
		String inputFile = fileToPath("contextCSV.txt");
		String outputFile = "C://patterns//test.txt";
		Formats inputFileformat = Formats.CSV;
		int sequenceCount = Integer.MAX_VALUE;
		
		SequenceDatabaseConverter converter = new SequenceDatabaseConverter();
		converter.convert(inputFile, outputFile, inputFileformat, sequenceCount);
	}

	

	public static String fileToPath(String filename) throws UnsupportedEncodingException{
		URL url = MainTestConvertSequenceDatabase.class.getResource(filename);
		 return java.net.URLDecoder.decode(url.getPath(),"UTF-8");
	}
}
